Skip to content

fix(topics): add visibility to topic types - #322

Merged
dielduarte merged 1 commit into
resend:mainfrom
mayankbohradev:fix/topic-visibility-types
Nov 25, 2026
Merged

dielduarte merged 1 commit into
resend:mainfrom
mayankbohradev:fix/topic-visibility-types

Conversation

@mayankbohradev

@mayankbohradev mayankbohradev commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds the documented visibility field to the topic create params, update params and the Topic type.

Why

The API accepts visibility on create and update, and returns it on get and list. The SDK already forwards the value. The types rejected it, so mypy reported documented usage as an error.

How

  • TopicVisibility is a literal alias for "public" and "private".
  • visibility is NotRequired on Topic, so code that builds a Topic dict still type-checks.
  • No runtime change.

Testing

  • Before the change, mypy reported 16 errors on the new tests.
  • tox -e lint, tox -e mypy and tox -e py pass (874 tests).
  • New sync and async tests cover request bodies and typed response access.

Notes for reviewers

New public name: resend.TopicVisibility. #321 also changes resend/version.py; I can rebase whichever merges second.


Summary by cubic

Fixes the topic types so visibility is accepted on create and update and returned on get and list, matching the API. The SDK already forwards and returns the value; the types rejected it, so mypy flagged documented usage as errors.

  • Adds resend.TopicVisibility, a literal for "public" or "private".
  • Adds optional visibility to Topics.CreateParams, Topics.UpdateParams, and Topic.
  • No runtime change besides a patch version bump.

Written for commit 115a81c. Summary will update on new commits.

View guided diff

The API accepts `visibility` on create and update, and returns it on
get and list. The SDK already sends and returns the value, but the
types rejected it, so mypy reported documented usage as an error.

- Add `TopicVisibility` ("public" or "private").
- Add `visibility` to `Topics.CreateParams` and `Topics.UpdateParams`.
- Add `visibility` to `Topic`.

Tested with tox lint, mypy and py (874 passed).
@dielduarte
dielduarte force-pushed the fix/topic-visibility-types branch from 39455b6 to 115a81c Compare November 25, 2026 14:48

@dielduarte dielduarte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!!

@dielduarte
dielduarte merged commit cdf230e into resend:main Nov 25, 2026
12 checks passed
@mayankbohradev
mayankbohradev deleted the fix/topic-visibility-types branch November 27, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants